from wtforms import IntegerField, StringField
from wtforms.validators import DataRequired, Length

from .base import BaseFrom


class CaseForm(BaseFrom):
    id = IntegerField(validators=[DataRequired(message="id不允许为空")])


class UpdateCaseForm(BaseFrom):
    url = StringField(validators=[DataRequired(message="url不允许为空"), Length(min=5)])
    name = StringField(validators=[DataRequired(message="name不允许为空"), Length(min=1)])
    method = StringField(validators=[DataRequired(message="method不允许为空")])
    group_id = IntegerField(validators=[DataRequired(message="id不允许为空")])
    headers = StringField(validators=[])
    body = StringField(validators=[])
    params = StringField(validators=[])
    id = IntegerField(validators=[])
    condition = StringField(validators=[])


class DebugCaseForm(UpdateCaseForm):
    pass
    # spaceID = IntegerField(validators=[DataRequired(message="id不允许为空")])
